<template>
  <div id="top">
    <div class="header">
      <div class="lt" @click="back()">
        <b>&lt;</b>
      </div>
      <div class="toptitle">
        <b>消息中心</b>
      </div>
    </div>
    <div class="btn">
      <input type="button" value="伴学消息" @click="fun('Section2')">
      <input type="button" value="课程消息" @click="fun('Section3')">
      <input type="button" value="平台消息" @click="fun('Section')">
    </div>
    <component :is="com"></component>    
  </div>
</template>

<script>
import Section from "./section.vue";
import Section2 from "./section2.vue";
import Section3 from "./section3.vue";
export default {
  methods: {
    fun(data) {
      this.com = data;
    },
    back() {
      this.$router.history.go(-1);
    }
  },
  data() {
    return {
      com: "Section"
    };
  },
  components: {
    Section,
    Section2,
    Section3
  }
};
</script>

<style scoped>
#top {
  width: 100%;
  height: 0.8rem;
  background-color: white;
  position: fixed;
  top: 0;
  z-index: 999;
}
.header {
  width: 100%;
  height: 0.5rem;
}
.lt {
  width: 0.52rem;
  height: 0.5rem;
  font-size: 0.26rem;
  text-align: center;
  line-height: 0.5rem;
  float: left;
}
.toptitle {
  width: 2.7rem;
  height: 0.5rem;
  line-height: 0.5rem;
  font-size: 0.16rem;
  float: left;
  text-align: center;
}
.btn {
  width: 100%;
  height: 0.3rem;
  border-bottom: 0.01rem solid #eeeeee;
}
.btn input {
  width: 33.3%;
  height: 100%;
  line-height: 0.3rem;
  font-size: 0.14rem;
  background-color: white;
  border: none;
}
</style>
